#region (c) 2014 THN Solutions LLC. - All rights reserved
/*
Simplified BSD License (BSD)
THN HTTP Stack Library
Copyright (c) 2014, THN Solutions LLC. ( www.ThnSolutions.com )
Author: Nguyễn, M. Hải                 ( www.Minh-Hai.com     )
All rights reserved.

Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:

    * Redistributions of source code must retain the above copyright notice, this 
      list of conditions and the following disclaimer.

    * Redistributions in binary form must reproduce the above copyright notice, 
      this list of conditions and the following disclaimer in the documentation 
      and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
POSSIBILITY OF SUCH DAMAGE.
*/
#endregion

#region Record of Change
//             							CHANGE HISTORY
// -------------------------------------------------------------------------------------
// |   DATE    | DEVELOPER  | DESCRIPTION                                              |
// -------------------------------------------------------------------------------------
// | 04-Nov-12 | HaiNM      | First creation.                                          |
// -------------------------------------------------------------------------------------
//
#endregion

#region Record of Audit
//             							REVIEW HISTORY
// -------------------------------------------------------------------------------------
// |   DATE    | REVIEWER   | NOTES                                                    |
// -------------------------------------------------------------------------------------
// -------------------------------------------------------------------------------------
//
#endregion

#region Using directives
using System;

using Thn;
#endregion

namespace Thn.Net.Http
{
    /// <summary>
    /// Failure reasons for parsing HTTP content.
    /// </summary>
#if DEBUG || TESTING
    public
#else
    public
#endif
 enum HttpParserFailureReason
    {
        /// <summary>
        /// There is no failure.
        /// </summary>
        None,
        /// <summary>
        /// Unknown error occurred.
        /// </summary>
        [TextDescription(Text = "Unknown error occurred.")]
        Unspecified,
        /// <summary>
        /// Cannot determine data length. This can be cause by having no Content-Length and no Connection:close.
        /// </summary>
        [TextDescription(Text = "Cannot determine data length. This can be cause by having no Content-Length and no Connection:close.")]
        NoDataLength,
        /// <summary>
        /// Data length is too big.
        /// </summary>
        [TextDescription(Text = "Data length is too big.")]
        DataLengthTooBig,
        /// <summary>
        /// There are too many headers.
        /// </summary>
        [TextDescription(Text = "There are too many headers.")]
        TooManyHeaderLines,
        /// <summary>
        /// Length of a header is too big.
        /// </summary>
        [TextDescription(Text = "Length of a header is too big.")]
        HeaderLineTooLong,
        /// <summary>
        /// Header line is not properly formatted.
        /// </summary>
        [TextDescription(Text = "Header line is not properly formatted.")]
        InvalidHeader,
        /// <summary>
        /// HTTP line is incorrect.
        /// </summary>
        [TextDescription(Text = "HTTP line is incorrect.")]
        InvalidHttp,
        /// <summary>
        /// Length of the HTTP line is too big.
        /// </summary>
        [TextDescription(Text = "Length of the HTTP line is too big.")]
        HttpLineTooLong,
        /// <summary>
        /// Could not find HTTP version in the first line.
        /// </summary>
        [TextDescription(Text = "Could not find HTTP version in the first line.")]
        NoHttpVersion,
        /// <summary>
        /// Could not find path section in the first line.
        /// </summary>
        [TextDescription(Text = "Could not find path section in the first line.")]
        NoPath,
        /// <summary>
        /// Could not find method section in the first line.
        /// </summary>
        [TextDescription(Text = "Could not find method section in the first line.")]
        NoMethod,
        /// <summary>
        /// Could not find status code section in the first line.
        /// </summary>
        [TextDescription(Text = "Could not find status code section in the first line.")]
        NoStatusCode,
        /// <summary>
        /// Could not find protocol section in the first line.
        /// </summary>
        [TextDescription(Text = "Could not find protocol section in the first line.")]
        NoProtocol
    }
}
